package com.usian.day01.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.usian.day01.mapper.UserMapper;
import com.usian.common.model.day01.User;
import com.usian.day01.service.UserService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author baimugudu
 * @email 2415621370@qq.com
 * @date 2023/7/25 15:20
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper,User> implements UserService {


    @HystrixCommand()
    public List<User> findByUser(String username,String password){
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        QueryWrapper<User> queryWrapper1 = queryWrapper.eq("username", username)
                .eq("password", password);

        List<User> users = this.baseMapper.selectList(queryWrapper1);
        return users;
    }

}
